home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / SPX30.ZIP / SPX_DOC.ZIP / SPX_LIB.DOC < prev    next >
Encoding:
Text File  |  1994-06-13  |  3.2 KB  |  89 lines

  1. { SPX Library Version 3.0  Copyright 1993 Scott D. Ramsay }
  2.  
  3.  SPX_LIB allows users to retrieve multiple files from one large archive
  4.   file.
  5.  
  6. ───────────────────────────────────────────────────────────────────────────
  7. type
  8.   tLibHandle = record
  9.                  open : pointer; { points to lib }
  10.                  cPos : longint; { current position }
  11.                  sPos : longint; { start position }
  12.                  size : longint; { size of file }
  13.                end;
  14.  
  15.   tLibHandle is a file handle type used for reading a file from an archive
  16. ───────────────────────────────────────────────────────────────────────────
  17. type
  18.   pSPXLib    = ^tSPXLib;
  19.   tSPXLib    = object(tobjs)
  20.  
  21.  
  22. VARIABLES:
  23.    open      : boolean;      { true = archive is open }
  24.    directory : pointer;      { data to the directory structure }
  25.    fileCount : word;         { number of files in the archive }
  26.    dirfile   : file;         { archive file handle }
  27.  
  28.    ---------------------------------------------------
  29.    constructor init(libName:string;LoadDir:boolean);
  30.  
  31.    Sets up the archive object.
  32.  
  33.    libName:   name of archive file to load
  34.    LoadDir:   start off loading Directory intro memory
  35.  
  36.    ---------------------------------------------------
  37.    procedure LoadDirectory; virtual;
  38.  
  39.    force loading of directory, if not already loaded.
  40.  
  41.    ---------------------------------------------------
  42.    procedure FreeDirectory; virtual;
  43.  
  44.    free the directory from memory.
  45.    ---------------------------------------------------
  46.    procedure OpenFile(fileName:string;var fileHandle:tLibHandle);virtual;
  47.  
  48.    Open a file from the archive for reading.
  49.  
  50.    fileName:    name of file (with out path name)
  51.    fileHandle:  the file handle to the file
  52.    ---------------------------------------------------
  53.    function ReadFile(var fileHandle:tLibHandle;var buffer;size:word):word;virtual;
  54.  
  55.    Read from the file.
  56.  
  57.    fileHandle:  file handle
  58.    buffer:      buffer to place data
  59.    size:        number of bytes to read
  60.    ---------------------------------------------------
  61.    function PosOfFile(var fileHandle:tLibHandle):longint;virtual;
  62.  
  63.    Returns the current positon of the open file.
  64.    ---------------------------------------------------
  65.    function EndOfFile(var fileHandle:tLibHandle):boolean;
  66.  
  67.    Returns true if the current position has reached the end of the file
  68.    ---------------------------------------------------
  69.    procedure SeekFile(var fileHandle:tLibHandle;position:longint);virtual;
  70.  
  71.    Changes the current position of the file
  72.    ---------------------------------------------------
  73.    procedure CloseFile(var fileHandle:tLibHandle);virtual;
  74.  
  75.    Closes the file.
  76.    ---------------------------------------------------
  77.    function LoadVSPfile(fileName:string;var buff):integer;virtual;
  78.  
  79.    Automatically load a .vsp file from the archive.
  80.    ---------------------------------------------------
  81.    function LoadColorsfile(fileName:string;var buff):integer;virtual;
  82.  
  83.    Automatically load a .PAL / .COL from the archive.
  84.    ---------------------------------------------------
  85.    destructor done;virtual;
  86.  
  87.    Deallocate the object
  88.    ---------------------------------------------------
  89.